package com.example.view;

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.example.common.base.AbsActivity;
import com.example.view.adapter.MainAdapter;
import com.example.view.bean.MainMenuBean;
import com.example.view.databinding.ActivityViewBinding;
import com.example.view.module.conflict.nestedscroll_a.NestedViewPagerActivity;
import com.example.view.utils.RouterUtils;
import com.example.view.mvp.HomeActivity;

import java.util.ArrayList;
import java.util.List;

@Route(path = "/view/main")
public class ViewMainActivity extends AbsActivity<ActivityViewBinding> {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle("View");
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_view;
    }

    @Override
    protected void main() {
        List<MainMenuBean> data = new ArrayList<>();
        data.add(new MainMenuBean("Slide", 0));
        data.add(new MainMenuBean("Realm and tree list", 0));
        data.add(new MainMenuBean("Animation", 0));
        data.add(new MainMenuBean("Mvp test", 0));
        data.add(new MainMenuBean("Limitless viewPager", 0));
        data.add(new MainMenuBean("Custom refresh", 0));
        data.add(new MainMenuBean("Draw view", 0));
        data.add(new MainMenuBean("ImageView view", 0));
        data.add(new MainMenuBean("Multi scroll", 0));
        data.add(new MainMenuBean("Design-Nested ViewPager scroll", 0));
        data.add(new MainMenuBean("Custom WaveView", 0));
        data.add(new MainMenuBean("Event case", 0));
        data.add(new MainMenuBean("Custom MySlide", 0));
        data.add(new MainMenuBean("Scroll ImageScroll", 0));
        data.add(new MainMenuBean("Animation Example", 0));
        data.add(new MainMenuBean("Event TouchEvent", 0));
        data.add(new MainMenuBean("History Menu", 0));
        data.add(new MainMenuBean("Conflict NestedViewPager", 0));
        MainAdapter adapter = new MainAdapter(data);
        adapter.setOnItemClickListener((adapter1, view, position) -> {
            switch (position) {
                case 0:
                    RouterUtils.jumpSlide(this);
                    break;
                case 1:
                    RouterUtils.jumpCity(this);
                    break;
                case 2:
                    RouterUtils.jumpAnimation(this);
                    break;
                case 3:
                    HomeActivity.open(this);
                    break;
                case 4:
                    RouterUtils.jumpLimitVp(this);
                    break;
                case 5:
                    RouterUtils.jumpCustomRefresh(this);
                    break;
                case 6:
                    RouterUtils.jumpDrawView(this);
                    break;
                case 7:
                    RouterUtils.jumpImageAttr(this);
                    break;
                case 8:
                    RouterUtils.jumpMultiScroll(this);
                    break;
                case 9:
                    RouterUtils.jumpDesignNestedViewpager(this);
                    break;
                case 10:
                    RouterUtils.jumpCustomWave(this);
                    break;
                case 11:
                    RouterUtils.jumpEventCase();
                    break;
                case 12:
                    RouterUtils.jumpCustomMySlide();
                    break;
                case 13:
                    RouterUtils.jumpScrollImage();
                    break;
                case 14:
                    RouterUtils.jumpAnimationExample();
                    break;
                case 15:
                    RouterUtils.jumpEventTouchEvent();
                    break;
                case 16:
                    RouterUtils.jumpActivityHistoryMenu();
                    break;
                case 17:
                    startActivity(new Intent(this, NestedViewPagerActivity.class));
                    break;
            }

        });

        mBinding.rv.setLayoutManager(new LinearLayoutManager(this));
        mBinding.rv.setAdapter(adapter);
    }

    @Override
    protected void initListener() {

    }


}
